home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / Tools / Development / envCPP31 / c++ / doc / c-keywords.doc next >
Encoding:
Text File  |  1999-05-13  |  80.2 KB  |  2,282 lines

  1. TABLE OF CONTENTS
  2.  
  3. /auto
  4. /break
  5. /case
  6. /char
  7. /const
  8. /continue
  9. /default
  10. /do
  11. /double
  12. /else
  13. /enum
  14. /extern
  15. /float
  16. /for
  17. /goto
  18. /if
  19. /int
  20. /long
  21. /register
  22. /return
  23. /short
  24. /signed
  25. /sizeof
  26. /static
  27. /struct
  28. /switch
  29. /typedef
  30. /union
  31. /unsigned
  32. /void
  33. /volatile
  34. /while
  35. /auto                                                                   /auto
  36.  
  37.    NAME
  38.       auto - Is an access modifier which declares variables to be
  39.              local.
  40.  
  41.    SYNOPSIS
  42.       auto <datatype> <variable list>;
  43.  
  44.    FUNCTION
  45.       Auto declares variables to be local.  It is almost never used
  46.       by anyone.  It exists only because it was part of the original
  47.       C set of keywords.  To declare a local variable all you need to
  48.       do is to declare it inside the code block that you intend to
  49.       use it in.  A code block begins at the start of a curly brace
  50.       "{" and ends with another curly brace "}".
  51.  
  52.    INPUTS
  53.       <datatype> - A basic C type or a user defined (complex) type.
  54.       <variable list> - A list of variables separated by commas.
  55.  
  56.    RESULT
  57.       none.
  58.  
  59.    EXAMPLE
  60.       auto int x, y, z = 25;
  61.  
  62.    NOTES
  63.       Never use, it just doesn't look very professional.
  64.  
  65.    BUGS
  66.       none. - If there are, there is something really wrong with your
  67.               compiler;-)
  68.  
  69.    SEE ALSO
  70.       extern, static, register.
  71.  
  72.       void, char, int, float, double,
  73.       long, short, signed, unsigned,
  74.       const, volatile.
  75.  
  76. /break                                                                 /break
  77.  
  78.    NAME
  79.       break - Used either as a part of a switch statement, or to
  80.               prematurely break out of a loop.
  81.  
  82.    SYNOPSIS
  83.       switch (<var>)
  84.       {
  85.          case <const1>:
  86.             <statement sequence>;
  87.             break;
  88.          case <const2>:
  89.             <statement sequence>;
  90.             break;
  91.          default:
  92.             <statement sequence>;
  93.       }
  94.  
  95.       or
  96.  
  97.       while (<var>==0)
  98.       {
  99.          if (<var>==0) break;
  100.          printf("This text will not be printed\n");
  101.       }
  102.  
  103.  
  104.    FUNCTION
  105.       This C keyword will prematurely break you out of a looping
  106.       structure or can be used to terminate a statement sequence
  107.       after a case statement.  In this last role it is optional
  108.       but is almost always used unless there is a specific reason
  109.       not to.
  110.  
  111.    INPUTS
  112.       none.
  113.  
  114.    RESULT
  115.       none.
  116.  
  117.    EXAMPLE
  118.       switch (x)
  119.       {
  120.          case 1:
  121.             printf("x is equal to 1.\n");
  122.             break;
  123.          case 2:
  124.             printf("x is equal to 2\n");
  125.             printf("and it is not equal to 1.\n");
  126.             break;
  127.          default:
  128.             printf("x is not equal to 1 or 2\n");
  129.             printf("it must be something else then.\n");
  130.       }
  131.  
  132.       or
  133.  
  134.       while (x==0)
  135.       {
  136.          if (x==0) break;
  137.          printf("This text will not be printed\n");
  138.       }
  139.  
  140.    NOTES
  141.       Switch statements do not require the break statement, but
  142.       in most instances you will want to use break.  An example
  143.       of when you wouldn't want to use break would be if you
  144.       wanted the first case <statement sequence> to execute and
  145.       also the second <statement sequence> if the first is called
  146.       but only the second if the second case is called.
  147.  
  148.    BUGS
  149.       none - If you're even considering that break might have a
  150.              bug, maybe you should either rethink the problem, or
  151.              invest in an expensive compiler, only to find that
  152.              the problem is still there.
  153.  
  154.    SEE ALSO
  155.       switch, continue.
  156.       case, for, while, do.
  157.  
  158. /case                                                                   /case
  159.  
  160.    NAME
  161.       case - Used with the switch statement
  162.  
  163.    SYNOPSIS
  164.       case <const>: <statement sequence>;
  165.  
  166.    FUNCTION
  167.       Case is used with the switch statement and can be considered
  168.       to be part of the switch statement as "do" is associated with
  169.       a "do while" loop.
  170.  
  171.    INPUTS
  172.       <const> - Any integer constant, can be either declared with
  173.                 the "const" keyword or simply typed in directly as
  174.                 an integer number.  Character constants and
  175.                 enumerations may be used also.
  176.       <statement sequence> - The single statement or block of
  177.                              statements which is/are to be executed
  178.                              by default.
  179.  
  180.    RESULT
  181.       none.
  182.  
  183.    EXAMPLE
  184.       switch (x)
  185.       {
  186.          case 1:
  187.             printf("x is equal to 1.\n");
  188.             break;
  189.          case 2:
  190.             printf("x is equal to 2\n");
  191.             printf("and it is not equal to 1.\n");
  192.             break;
  193.          default:
  194.             printf("x is not equal to 1 or 2\n");
  195.             printf("it must be something else then.\n");
  196.       }
  197.  
  198.    NOTES
  199.       It should be noted that in a switch statement any constant of
  200.       type char, (or any other type other than an int), will first
  201.       be converted to an integer.  This doesn't really matter as
  202.       far as the programmer is concerned unless the variable type
  203.       is larger than an integer, in which case the value will get
  204.       garbled and the program will behave in a way which was
  205.       unintended.  The reason switch will only handle integral types
  206.       is for speed reasons.
  207.  
  208.    BUGS
  209.       As stated above, only works with types smaller or equal in
  210.       size to integers.
  211.  
  212.    SEE ALSO
  213.       switch, break, const, int, char.
  214.  
  215. /char                                                                   /char
  216.  
  217.    NAME
  218.       char - Is a data type which declares a variable of type char.
  219.  
  220.    SYNOPSIS
  221.       char <variable list>;
  222.  
  223.    FUNCTION
  224.       Char declares a variable of type char, meaning that the
  225.       variable will hold a single ASCII character.  Technically
  226.       type char is an 8 bit type that will hold any number between
  227.       -128 and 127.  Often operating systems will declare their own
  228.       variable types and will usually have one called BYTE or UBYTE
  229.       or the like which is either a char or unsigned char.
  230.  
  231.    INPUTS
  232.       <variable list> - A list of the variables you are declaring,
  233.                         separated by commas.
  234.  
  235.    RESULT
  236.       none.
  237.  
  238.    EXAMPLE
  239.       char x, y = 'a', z[257] = "This is a string of characters";
  240.  
  241.    NOTES
  242.       To store a string of characters in a variable,
  243.       (i.e. Hello there) you make an array of characters and store
  244.       each letter in one element of that array.  The declaration
  245.       would look like this, (char thsisastrn[257];)  You could
  246.       then store a sentence of up to 256 characters in length.
  247.       Also I'd like to mention that there is a w_char type that isn't
  248.       a built in C type but is defined in one of the standard headers
  249.       and can be used to store characters for languages besides
  250.       english and the like.  I believe that w_char is usually used
  251.       for unicode, but I'm not really sure about the details.  If
  252.       your interested in making your programs portable to other
  253.       countries and cultures then check it out.  Also it should be
  254.       noted that in C++ w_char is a built in type.
  255.  
  256.    BUGS
  257.       none. - Man, if you've got bugs with this, you've got some
  258.               serious problems!!!
  259.  
  260.    SEE ALSO
  261.       void, int, float, double.
  262.  
  263.       long, short, signed, unsigned,
  264.       const, volatile,
  265.       extern, static, register, auto,
  266.       struct, union, typedef, enum.
  267.  
  268. /const                                                                 /const
  269.  
  270.    NAME
  271.       const - Is an access modifier which is used to declare a
  272.               special "constant" variable type.
  273.  
  274.    SYNOPSIS
  275.       const <datatype> <name> = <expression>, <name> = <expression>,
  276.       etc, etc;
  277.  
  278.    FUNCTION
  279.       Const declares and initializes variables which cannot be
  280.       altered by the program after initialization.  The declaration
  281.       looks the same as a normal variable declaration with the
  282.       exception that the "const" keyword precedes it, and each
  283.       constant must be initialized at the time it is declared, (i.e.
  284.       given a value such as x = 25).  An example of a practical use
  285.       would be to make PI a const float equal to 3.14...
  286.  
  287.    INPUTS
  288.       <datatype> - A basic C datatype, (i.e. char, int, float, double),
  289.                    or a user defined (complex) data type.
  290.       <name> - Name of the constant being declared.
  291.       <expression> - Any "statement" which evaluates to  the
  292.                      declared type, (i.e. For type int, 25 would be
  293.                      acceptable).
  294.  
  295.    RESULT
  296.       none.
  297.  
  298.    EXAMPLE
  299.       const float PI = 3.14, e_raised2_x = 2.71828;
  300.  
  301.    NOTES
  302.       While const types may not be altered by the program, they may
  303.       be altered by some hardware dependent means.  A good example of
  304.       this would be to store the address of a place in memory that
  305.       always contains the current time in a constant pointer that
  306.       your program can't alter, but can look at whenever it wants
  307.       to know the time.  Honestly a technique like this might make
  308.       more sense in C++ where you can declare variable in the middle
  309.       of your code.  Also in this example you should probably use
  310.       the keyword volatile to keep the compiler from doing any
  311.       optimizations that would cause flaky results.  I was really
  312.       just giving it as a for instance so you can take it or leave
  313.       it.  Also, the word "constant" refers to both the special type
  314.       and any fixed value in the program,
  315.       (i.e. 25+25 or "Hello world\n").  The reason for this is that
  316.       from the compiler's point of view they are stored in the same
  317.       way.  Also, you can think of it from the standpoint that 25+25
  318.       is a constant expression because the answer will always be 50.
  319.       In many cases, (OK ALL CASES), you may use a #define
  320.       preprocessor directive in place of the const variable type.
  321.       It should be noted, however, that #define works in a different
  322.       manner than const does, (at least from the compilers point of
  323.       view.)
  324.  
  325.    BUGS
  326.       none.
  327.  
  328.    SEE ALSO
  329.       volatile, #define.
  330.       void, char, int, float, double,
  331.       long, short, signed, unsigned.
  332.  
  333.       extern, static, register, auto,
  334.       struct, union, typedef, enum.
  335.  
  336. /continue                                                           /continue
  337.  
  338.    NAME
  339.       continue - Used in a loop to force the next iteration, (cycle),
  340.                  immediately.
  341.  
  342.    SYNOPSIS
  343.       for (<var>=0; <var><100; <var>++)
  344.       {
  345.          if (<var>>=50) continue;
  346.          printf("%d\n", <var>);
  347.       }
  348.  
  349.    FUNCTION
  350.       Continue is used to force the next iteration of a looping
  351.       structure, (i.e. for, while, do while).  Continue is used in
  352.       much the same manner as the break statement, except that
  353.       instead of breaking completely out of the loop, it just causes
  354.       the loop to skip to the end, and then start on the next
  355.       iteration.  In the examples for instance, only the numbers
  356.       0-49 are printed even though the loop is executed and the <var>
  357.       is incremented 100 times.
  358.  
  359.    INPUTS
  360.       none.
  361.  
  362.    RESULT
  363.       none.
  364.  
  365.    EXAMPLE
  366.       for (x = 0; x<100; x++)
  367.       {
  368.          if( x>=50) continue;
  369.          printf("%d\n", x);
  370.       }
  371.  
  372.    NOTES
  373.       When continue is used in a for loop, the variable is
  374.       incremented, then the conditional statement is tested, then the
  375.       loop starts again.  This is the same action which would take
  376.       place if the end of the code block had been reached.  In
  377.       "while" and "do while", only the conditional statement is
  378.       evaluated, (as they do not have the built in ability to
  379.       increment variables), and then the loop starts again.
  380.  
  381.    BUGS
  382.       none.
  383.  
  384.    SEE ALSO
  385.       break.
  386.       for, while, do.
  387.  
  388. /default                                                             /default
  389.  
  390.    NAME
  391.       default - Used in conjunction with the switch statement to
  392.                 specify a default course of action.
  393.  
  394.    SYNOPSIS
  395.       default: <statement sequence>;
  396.  
  397.    FUNCTION
  398.       Default is used in conjunction with the switch statement to
  399.       specify a default course of action when no case statements
  400.       have been matched.  In essence, it is to switch, what else is
  401.       to if.
  402.  
  403.    INPUTS
  404.       <statement sequence> - The single statement or block of
  405.                              statements which is/are to be executed
  406.                              by default.
  407.  
  408.    RESULT
  409.       none.
  410.  
  411.    EXAMPLE
  412.       switch (x)
  413.       {
  414.          case 1:
  415.             printf("x is equal to 1.\n");
  416.             break;
  417.          case 2:
  418.             printf("x is equal to 2\n");
  419.             printf("and it is not equal to 1.\n");
  420.             break;
  421.          default:
  422.             printf("x is not equal to 1 or 2\n");
  423.             printf("it must be something else then.\n");
  424.       }
  425.  
  426.    NOTES
  427.       none.
  428.  
  429.    BUGS
  430.       none.
  431.  
  432.    SEE ALSO
  433.       switch, case.
  434.  
  435. /do                                                                       /do
  436.  
  437.    NAME
  438.       do - Part of the "do while" looping construct.
  439.  
  440.    SYNOPSIS
  441.       do
  442.       {
  443.          <statement sequence>;
  444.       } while (<conditional statement>);
  445.  
  446.    FUNCTION
  447.       Do is used to start a "do while" loop.  A "do while" loop
  448.       behaves in almost the same manner as a while loop, with the
  449.       exception that the <statement sequence> is executed before
  450.       the <conditional statement>.  This has the effect that the
  451.       loop always executes at least once regardless of whether the
  452.       <conditional statement> is true or false.
  453.  
  454.    INPUTS
  455.       <statement sequence> - The single statement or block of
  456.                              statements which is/are to be executed.
  457.       <conditional statement> - A statement which evaluates to either
  458.                                 true or false.  False is equal to 0
  459.                                 and true is anything else, however
  460.                                 it is common practice to have -1 or 1
  461.                                 represent true.
  462.  
  463.    RESULT
  464.       none.
  465.  
  466.    EXAMPLE
  467.       do
  468.       {
  469.          printf("Enter a number between 1 & 5...\n");
  470.          scanf("%d", &x);
  471.       } while ((x<1) || (x>5));
  472.  
  473.    NOTES
  474.       In the example above the loop reads in x from the user and then
  475.       tests to see if that value is acceptable.  A "while" loop could
  476.       not have been used effectively because x could have been set to
  477.       anything, including a value which would have caused the
  478.       program to skip the loop entirely.  You could conceivably
  479.       set x to zero before you enter a "while" loop, but it is
  480.       easier and more readable simply to use "do while".  Nuff said.
  481.  
  482.    BUGS
  483.       none.
  484.  
  485.    SEE ALSO
  486.       while, for.
  487.       if, switch.
  488.  
  489. /double                                                               /double
  490.  
  491.    NAME
  492.       double - Is a data type and keyword used to declare variables
  493.                which hold double precision floating point values.
  494.  
  495.    SYNOPSIS
  496.       double <variable list>;
  497.  
  498.    FUNCTION
  499.       Double declares variables that can be used to store double
  500.       precision floating point numbers.  A double precision number
  501.       is 64 bits wide in memory, meaning that the number can
  502.       range from -1.7e-308 to 1.7e308.  It should be noted that
  503.       unlike int, but like float, the double type can be used to
  504.       store fractional numbers which are extremely small or extremely
  505.       large.  Double should be used when variables of type float are
  506.       too small to hold the desired number or when extreme accuracy
  507.       in calculations is needed.
  508.  
  509.    INPUTS
  510.       <variable list> - A list of the variables you are declaring,
  511.                         separated by commas.
  512.  
  513.    RESULT
  514.       none.
  515.  
  516.    EXAMPLE
  517.       double x, y, z = 3.14;
  518.  
  519.    NOTES
  520.       In older versions of C, double was a synonym for long float.
  521.       As per the ANSI standard, long float is no longer accepted and
  522.       the double keyword must be used.  Both float and double require
  523.       more space and more CPU time to do calculations on than do
  524.       ints.  Try to avoid using them inside of loops that are crucial
  525.       to the speed of the program.  Instead try to put them in places
  526.       where the expression in question only gets executed every now
  527.       and then, and not 100 times a second.  There is a way to do
  528.       division on ints so that the remainder is known.  This is much
  529.       faster and more information is available, (see div).  Many
  530.       times you must link a special library to your code to do
  531.       floating point math, (i.e. to be able to use floats and
  532.       doubles).  This is because they are so much slower and most
  533.       programmers try to avoid them except in special cases.  It is
  534.       also because there are different ways for the compiler to do
  535.       the math internally.  If you have an FPU for example, you can
  536.       compile your code to take advantage of that special hardware by
  537.       linking it to a library that supports an FPU, or you can link
  538.       to a generic library, (mieee library for example), and all of
  539.       the calculations will be preformed by the software, with the
  540.       effect that your program will run on computers that aren't
  541.       lucky enough to have an FPU, (like my computer for example).
  542.       If in doubt, use mieee, it's safer.  When I speak of libraries
  543.       it should be noted that I am talking about link libraries which
  544.       come with your compiler and not the amigados shared libraries
  545.       which reside in the libs: assign.
  546.  
  547.    BUGS
  548.       Slow.
  549.  
  550.    SEE ALSO
  551.       void, int, char, double.
  552.  
  553.       long, short, signed, unsigned,
  554.       const, volatile,
  555.       extern, static, register, auto,
  556.       struct, union, typedef, enum.
  557.  
  558. /else                                                                   /else
  559.  
  560.    NAME
  561.       else - Part of the if statement which specifies a default
  562.              course of action, (OPTIONAL).
  563.  
  564.    SYNOPSIS
  565.       if (<conditional statement>)
  566.       {
  567.          <statement sequence>;
  568.       }
  569.       else
  570.       {
  571.          <statement sequence>;
  572.       }
  573.  
  574.    FUNCTION
  575.       Else specifies a default course of action to take when the
  576.       <conditional statement> evaluates to false.  If it evaluates
  577.       to true then else is skipped.
  578.  
  579.    INPUTS
  580.       <conditional statement> - A statement which evaluates to either
  581.                                 true or false.  False is equal to 0
  582.                                 and true is anything else, however
  583.                                 it is common practice to have -1 or 1
  584.                                 represent true.
  585.       <statement sequence> - The single statement or block of
  586.                              statements which is/are to be executed
  587.                              by default.
  588.  
  589.    RESULT
  590.       none.
  591.  
  592.    EXAMPLE
  593.       if (x)
  594.       {
  595.          printf("x is unequal to zero.\n");
  596.       }
  597.       else
  598.       {
  599.          printf("x is 0.\n");
  600.       }
  601.  
  602.    NOTES
  603.       Else can be used in a couple of ways.  It can be used as shown
  604.       above to produce an either or type of decision or can be used
  605.       to string together several ifs, (i.e.
  606.  
  607.       if (x==0) {<statement sequence>;}
  608.       else if (x<0) {<statement sequence>;}
  609.       else if (x>0) {<statement sequence>;}).
  610.  
  611.       You could just use 3 ifs in this situation, however the
  612.       "if else if ladder" executes faster because if the first
  613.       expression is met then the rest are skipped by default and
  614.       don't waste time evaluating to false.
  615.  
  616.    BUGS
  617.       none.
  618.  
  619.    SEE ALSO
  620.       if, switch.
  621.       for, while, do.
  622.  
  623. /enum                                                                   /enum
  624.  
  625.    NAME
  626.       enum - Defines an enumeration data type, and is used to declare
  627.              variables of that type.
  628.  
  629.    SYNOPSIS
  630.       enum <tagname> {<enumeration list>} <variable list>;
  631.  
  632.    FUNCTION
  633.       Enum defines a new data type, much the same way struct and
  634.       union do.  These new data types that the user creates are
  635.       often referred to as "user defined types".  Enum is also used
  636.       in the declaration of variables that are to be of a type
  637.       which was defined using enum.  Enum really can't be
  638.       explained without an example so we'll refer to the example
  639.       below.  "coins" is the new data type.  "money" is a global
  640.       variable of type coins.  "moremoney" is a local variable of
  641.       type coins.  Now that we have our two variables "money" and
  642.       "moremoney" we can assign them a value of type coins, (i.e.
  643.       any of {penny, nickel, dime, or quarter}.  Conditional tests
  644.       may be performed on "money" and "moremoney".  We used switch
  645.       below, but you may use if statements, while, for, do while,
  646.       or any other C construct that allows conditional (true/false)
  647.       tests.  I think if you look over the example, you'll get the
  648.       idea of what enumerations are good for.
  649.  
  650.    INPUTS
  651.       <tagname> - The name of the variable type being created, (i.e.
  652.                   you would use this name when declaring variables
  653.                   of this type.
  654.       <enumeration list> - The list of enumeration names that will
  655.                            be used as the "pseudo data" for any
  656.                            variable being declared as type <tagname>.
  657.       <variable list> - A list of the variables you would like to
  658.                         declare separated by commas.  This allows
  659.                         variables to be declared at the same time
  660.                         the data type is defined.
  661.  
  662.    RESULT
  663.       none.
  664.  
  665.    EXAMPLE
  666.       enum coins {penny, nickel, dime, quarter} money;
  667.  
  668.       int main(void)
  669.       {
  670.          enum coins moremoney;
  671.  
  672.          money = penny;
  673.          moremoney = dime;
  674.  
  675.          switch (money)
  676.          {
  677.             case penny: printf("Hey I've got a penny.\n");
  678.             break;
  679.             case nickel: printf("Hey I've got a nickle.\n");
  680.             break;
  681.             case dime: printf("Hey I've got a dime.\n");
  682.             break;
  683.             case quarter: printf("Hey I've got a quarter.\n");
  684.          }
  685.  
  686.          switch (moremoney)
  687.          {
  688.             case penny: printf("Hey, I've got another penny.\n");
  689.             break;
  690.             case nickel: printf("Hey, I've got another nickel.\n");
  691.             break;
  692.             case dime: printf("Hey, I've got another dime.\n");
  693.             break;
  694.             case quarter: printf("Hey, I've got another quarter.\n");
  695.          }
  696.  
  697.          exit(0);
  698.       }
  699.  
  700.  
  701.    NOTES
  702.       It should be noted that enum is just a fancy way of disguising
  703.       the int variable type.  In the example above "money = penny" is
  704.       equivalent to "money = 0", and "moremoney = dime" is equal to
  705.       "moremoney = 2".  The <enumeration list> assigns the different
  706.       names integer values beginning with 0 and going up by one, (i.e.
  707.       1, 2, 3, 4, 5, 6, etc).  You can alter this pattern by using
  708.       an assignment in the definition, (i.e.  enum coins {penny = 0,
  709.       nickel = 5, dime = 10, quarter = 25}.  By doing this you could
  710.       create tests like ( if (nickle+nickle==dime) printf("2 nickels
  711.       equals 1 dime.");).  You can even assign two names the same
  712.       value, (i.e. enum coins {penny, nickel, dime, quarter,
  713.       two_bits = 3, half_dollar}.  In this situation penny = 0,
  714.       nickel = 1, dime = 2, quarter = 3, two_bits = 3, and
  715.       half_dollar = 4.
  716.  
  717.    BUGS
  718.       Any restrictions that would apply to type int, also apply to
  719.       enums, on the other hand any advantages that ints have over
  720.       other types also apply to enums.  This is why enumerations
  721.       work with the switch statement so well.
  722.  
  723.    SEE ALSO
  724.       struct, union, typedef.
  725.  
  726.       switch, if,
  727.       for, while, do.
  728.  
  729. /extern                                                               /extern
  730.  
  731.    NAME
  732.       extern - Is an access modifier used in variable declarations
  733.                to specify that the variable is declared in another
  734.                source file which will be linked later.
  735.  
  736.    SYNOPSIS
  737.       extern <data type> <variable list>;
  738.  
  739.    FUNCTION
  740.       Extern is used in variable declarations to specify that the
  741.       variable is declared in another source file which will be
  742.       linked later.  It isn't a definition per say, but merely lets
  743.       the compiler know that the variable is out there.  If you don't
  744.       tell the compiler that the variable is declared elsewhere
  745.       then it will most likely spit up an "unknown identifier" error,
  746.       and if you don't use the extern keyword then the linker will
  747.       spit out a "multiply declared identifier" error or something
  748.       like that.  Basically, a program can't define something
  749.       twice, so you have to use extern to tell the compiler that even
  750.       though this variable hasn't been declared yet, it can still go
  751.       ahead and compile the proggy just as if it had been declared.
  752.  
  753.    INPUTS
  754.       <data type> - Is any one of C's built in data types like: int,
  755.                     char, float, double, etc.  Also you may use your
  756.                     own user defined (complex) data types,
  757.                     (i.e., structs, unions, etc).
  758.       <variable list> - Is a list of variables that have been
  759.                         declared elsewhere, separated by commas.  see
  760.                         the example for clarification.
  761.  
  762.    RESULT
  763.       none.
  764.  
  765.    EXAMPLE
  766.       /* sourcenumber1.c */
  767.       void testfunction(void);
  768.  
  769.       int x, y = 2, z[50] = {0};
  770.  
  771.       int main(void)
  772.       {
  773.          testfunction();
  774.  
  775.          return 0;
  776.       }
  777.  
  778.       /* sourcenumber2.c */
  779.       extern int x, y, z[50];
  780.  
  781.       void testfunction(void)
  782.       {
  783.          printf("%d, %d, %d\n", x, y, z[0]);
  784.       }
  785.  
  786.    NOTES
  787.       The example above is cut up into two source files.  Something
  788.       to note about using extern is that it only makes sense to use
  789.       it when dealing with multiple source code files.  Also notice
  790.       how the arrays were handled.  Typically I like to declare
  791.       something as external exactly the same way I declared it
  792.       originally, (but without the initialization).  In the second
  793.       source file I could just as easily have written,
  794.       (extern x, y, z[];).  Stick to whatever makes the most sense
  795.       to you, I just find it easier to mimic the original form as
  796.       it's less semantic bs to remember and I think it aids in
  797.       readability.
  798.  
  799.    BUGS
  800.       I certainly hope not!!!
  801.  
  802.    SEE ALSO
  803.       volatile, register,
  804.       const, signed, unsigned, short, long.
  805.  
  806.  
  807. /float                                                                 /float
  808.  
  809.    NAME
  810.       float - Is a data type used for holding floating point numbers
  811.               between -3.4e38 and 3.4e38.
  812.  
  813.    SYNOPSIS
  814.       float <variable list>;
  815.  
  816.    FUNCTION
  817.       float is a data type used for holding floating point numbers
  818.       between -3.4e38 and 3.4e38.  A floating point number takes more
  819.       time for the computer to do calculations on than int.  It is
  820.       always preferable to use int if you can use one type or the
  821.       other however there are just some spots that you can't get out
  822.       of using floating point numbers.  Floating point numbers are
  823.       useful in two common happenstances: one, the number being
  824.       stored is of exceptional accuracy, (like .000231), and
  825.       maintaining that accuracy is crucial, or two, if the number is
  826.       too large to store in an int or a long int,
  827.       (like 3.2861 * 10^28).
  828.  
  829.    INPUTS
  830.       <variable list> - A list of the variables being declared
  831.                         separated by commas.
  832.  
  833.    RESULT
  834.       none.
  835.  
  836.    EXAMPLE
  837.       float x, y = 3.14, z[5] = {2.2, 3.3, 4.4, 5.5, 6.6};
  838.  
  839.    NOTES
  840.       When you do decide you need floats, try to avoid using them
  841.       inside of loops that that are crucial to the speed of the
  842.       program.  Instead try to put them in places where the
  843.       expression in question only gets executed every now and then,
  844.       and not 100 times in a second.  There is a way to do
  845.       division on ints so that the remainder is known.  This is much
  846.       faster and more information is available, (see div).  Many
  847.       times you must link a special library to your code to do
  848.       floating point math, (i.e. to be able to use floats and
  849.       doubles).  This is because they are so much slower and most
  850.       programmers try to avoid them except in special cases.  It is
  851.       also because there are different ways for the compiler to do
  852.       the math internally.  If you have an FPU for example, you can
  853.       compile your code to take advantage of that special hardware by
  854.       linking it to a library that supports an FPU, or you can link
  855.       to a generic library, (mieee library for example), and all of
  856.       the calculations will be preformed by the software, with the
  857.       effect that your program will run on computers that aren't
  858.       lucky enough to have an FPU, (like my computer for example).
  859.       If in doubt, use mieee, it's safer.  When I speak of libraries
  860.       it should be noted that I am talking about link libraries which
  861.       come with your compiler and not the amigados shared libraries
  862.       which reside in the libs: assign.
  863.  
  864.    BUGS
  865.       Contact the manufacturer of your compiler on this one, they've
  866.       obviously been exposed to too many drugs in the 60's.
  867.  
  868.    SEE ALSO
  869.       void, int, char, double.
  870.  
  871.       long, short, signed, unsigned,
  872.       const, volatile,
  873.       extern, static, register, auto,
  874.       struct, union, typedef, enum.
  875.  
  876. /for                                                                     /for
  877.  
  878.    NAME
  879.       for - The C keyword used for constructing, (most notably), a
  880.             for loop.  The for keyword is very versatile however, and
  881.             can be used to construct different kinds of loops,
  882.             (like infinite loops, and pseudo while loops).
  883.  
  884.    SYNOPSIS
  885.       for (<variable assignments>; <test conditions>; <statements>)
  886.       {
  887.          <statement sequence>;
  888.       }
  889.  
  890.    FUNCTION
  891.       The for loop is useful for keeping track of how many iterations
  892.       have gone by during an operation, and also to terminate based
  893.       on either the number iterations, or on some other unrelated
  894.       criteria.  C for loops have much more bite to them then other
  895.       languages.  A for loop is really just a while loop with added
  896.       capabilities.  The statement for (;x<10;) printf("Hi\n"); is
  897.       exactly equivalent to while (x<10) printf("Hi\n");, (Well at
  898.       least functionally it is, I don't know how the computer sees
  899.       it).  All of the parts of the for loop are completely optional
  900.       so you can pick and choose what you need and what you don't.
  901.       for example the statement for (;;) {  }  throws the program
  902.       into an infinite loop, which may only be broken out of
  903.       using a break statement.  Also it is worthwhile to mention
  904.       that each part of the for loop may contain multiple
  905.       declarations, test conditions, and statements. for instance
  906.       for (x = 0, y = 10; x<=10 && y>=0; x++, y--)
  907.          printf("%3d, %3d\n", x, y);
  908.       tells the program to set x equal to 0 and y to 10, to keep
  909.       going until either x is greater than 10 or y becomes less than
  910.       zero and to increment x and decrement y after printf() prints
  911.       it's little message.
  912.  
  913.    INPUTS
  914.       <variable assignments> - A list of variables to assign a value
  915.                                to, or in rare cases any other
  916.                                statement you would wish only to
  917.                                execute at the beginning of the for
  918.                                loop.  Frankly statements should
  919.                                probably just come before the for
  920.                                loop as a matter of good form.  Each
  921.                                assignment should be separated by a
  922.                                comma.
  923.       <test conditions> - Truly only one test condition can be put
  924.                           here, however, in practice you may just
  925.                           separate each test condition by a && or
  926.                           || or any other C test operator depending
  927.                           on how you think the thing should work,
  928.                           and thus have multiple test conditions.
  929.       <statements> - I called this one statements for lack of a
  930.                      better word.  This space is typically used for
  931.                      incrementing and/or decrementing the values
  932.                      initialized in the first part of the for loop,
  933.                      however, any statements may go here.  Again
  934.                      I think as a matter of good form you should
  935.                      try to stick to incrementing and decrementing,
  936.                      and if you really have to have some statements
  937.                      execute, then just stick them at the end of the
  938.                      <statement sequence>.
  939.       <statement sequence> - The single statement or block of
  940.                              statements which is/are to be executed.
  941.  
  942.    RESULT
  943.       none.
  944.  
  945.    EXAMPLE
  946.       for (x = 0, y = 0; x < 10; x++, y+=2)
  947.       {
  948.          printf("%3d, %3d\n", x, y);
  949.       }
  950.  
  951.    NOTES
  952.       When I first learned C, coming from BASIC, I thought that C
  953.       for loops were needlessly ambiguous, and generally retarded,
  954.       however later, after a couple books, much tinkering, and a lot
  955.       of, "Ohhhhh, that's why;)", I learned that the small sacrifice
  956.       in straight forwardness yielded 10 times to the functionality
  957.       and applicability of the construct.  I personally regard the C
  958.       for loop as one of the most useful features of the language,
  959.       and it's certainly something that sets it apart from most other
  960.       languages which lock you into a certain way of doing it.
  961.       The way I got through the fact that the C for loop isn't very
  962.       obvious to the beginning programmer, is to invent a dialogue
  963.       for translating what the for loop is doing into English.  When
  964.       you see the statement
  965.       for (x = 0; x < 10; x++) {printf("hi\n");
  966.       you can translate it as , set x equal to 0, while x is less
  967.       than 10 execute printf("hi\n") and increment x, then repeat.
  968.       It's useful to look at the for loop as a while loop with added
  969.       capabilities.  Also remember that any and all parts of a for
  970.       loop are completely optional, and that each part may contain
  971.       multiple statements, test conditions etc.
  972.  
  973.    BUGS
  974.       Bugs you say, nope, none here.
  975.  
  976.    SEE ALSO
  977.       do, while, switch, break, continue, default, if, else.
  978.  
  979. /goto                                                                   /goto
  980.  
  981.    NAME
  982.       goto - Jumps to another part of the program.  NEVER USE!!!!
  983.              If your code ever leeks out and other programmers get
  984.              wind, you're reputation will never recover, companies
  985.              won't hire you, you'll be an outcast, shunned by all
  986.              but the most loathsome of BASIC programmers.
  987.  
  988.    SYNOPSIS
  989.       goto <label>
  990.  
  991.  
  992.       <label>:
  993.  
  994.    FUNCTION
  995.       Goto has no function, it has no reason to exist, but to satisfy
  996.       those unimaginative BASIC programmers who dare set their
  997.       obviously unadaptable feet into C water just to have them
  998.       ripped off by some shark in the guise of a nerdy keyboard
  999.       jockey.  No, but seriously, goto is regarded by all as bad
  1000.       programming technique, and should be avoided at all cost on
  1001.       pain of unintelligible source code, both to you and anyone else
  1002.       who might have business with it later.  There is only one
  1003.       conceivable instance that I'm aware of where goto might be an
  1004.       actual benefit to source code readability.  Say you have
  1005.       yourself nested in several layers of loops and some condition
  1006.       happens, (maybe an error or even some debug code), and you have
  1007.       to exit out of all of the loops.  It is inconvenient to use
  1008.       breaks, because you have to put one into every loop until your
  1009.       safely back into wherever the original calling code was.
  1010.       Frankly, it's probably a better idea to rethink the way your
  1011.       doing it and try to come up with a way that doesn't involve
  1012.       goto unless it's just temporary debug code which will be taken
  1013.       out after the bug has been solved.
  1014.  
  1015.    INPUTS
  1016.       <label> - Is the only argument goto takes.  You must put a
  1017.                 label somewhere in the code of the current function
  1018.                 you are in.  goto will not find a label if it is
  1019.                 located in another function.  the label is followed
  1020.                 by a colon when marking the location, but not when
  1021.                 used with goto.  If I didn't explain that well see
  1022.                 the example and it should become clear.
  1023.  
  1024.    RESULT
  1025.       none.
  1026.  
  1027.    EXAMPLE
  1028.       label:
  1029.          printf("Hello World ;-)\n");
  1030.       goto label;
  1031.  
  1032.    NOTES
  1033.       A lot of C and C++ programmers truly wonder why goto was
  1034.       included in the language when it already had such a rich set of
  1035.       control structures?  I personally believe it's because C was
  1036.       originally cooked up in the 60s or 70s, or something, when
  1037.       basic programming was all the rage.  When people finally
  1038.       realized that goto wasn't all it was cracked up to be, it was
  1039.       too late to take it out of the language for backward
  1040.       compatibility's sake.  That being said I'll make a note here
  1041.       that should in no way convince you that using goto is OK.  Goto
  1042.       is generally faster than the built in control structures
  1043.       because it's tailored to the specific task at hand and doesn't
  1044.       generate redundant code.  Also I think each time you use a C
  1045.       control stucture there's a certain amount of overhead involved,
  1046.       but don't quote me on that.  If you ever look at assembly,
  1047.       you'll see the equivilant of gotos all over the place.  Goto
  1048.       is alot closer to how the machine thinks than the other control
  1049.       structures.  However, truly the amount of time lost by using C
  1050.       constructs is truly minimal and is barely worth mentioning.
  1051.       Personally, and I know someone is going to blast me for this,
  1052.       I'm glad it was included in the language, even though I and
  1053.       nobody else ever uses it.  I always like having the choice to
  1054.       do things the way I like, which is truly what C programming is
  1055.       all about anyway.  The language doesn't dictate matters of
  1056.       style, that job is left to the programmer where it belongs.
  1057.       P.S. Unions also fall into the category of "why", but again,
  1058.       I think that just because a feature doesn't fit all situations,
  1059.       or even most situations, it is at least nice to know it's there
  1060.       for that one out of a million chance you might actually use it.
  1061.  
  1062.    BUGS
  1063.       You shouldn't use this keyword enough to know if there are any
  1064.       bugs.  In fact, if you're still reading this, there's something
  1065.       wrong.  Here, directly below are a list of things you can use
  1066.       instead.
  1067.  
  1068.    SEE ALSO
  1069.       for, while, do, switch, break, continue,
  1070.       THE WHOLE CONCEPT OF USING FUNCTIONS TO ENCAPSULATE CODE & DATA
  1071.  
  1072.  
  1073. /if                                                                       /if
  1074.  
  1075.    NAME
  1076.       if - Used to form (if-then) constructs.  Is the basic way to
  1077.            make decisions in C.
  1078.  
  1079.    SYNOPSIS
  1080.       if (<conditional statement>)
  1081.       {
  1082.          <statement sequence>;
  1083.       }
  1084.       else if (<conditional statement>)
  1085.       {
  1086.          <statement sequence>;
  1087.       }
  1088.       else
  1089.       {
  1090.          <statement sequence>;
  1091.       }
  1092.  
  1093.    FUNCTION
  1094.       If is used to form (if-then) constructs.  It is the basic way
  1095.       to make decisions in C.  Basically, anytime you have to choose
  1096.       between two courses of action based on some data or user input
  1097.       you use an if.  If tests for truth, (if such and such is true
  1098.       then do something or other else do this other thing).  Anything
  1099.       that is unequal to 0 is true, zero is false.  2+2 is true,
  1100.       2-2 is false...  If this makes little sense, don't worry, I'm
  1101.       not explaining it well anyway.  if you put a statement in your
  1102.       code like printf("%d\n", 2==2), then the output would most
  1103.       likely be 1 or -1, but could honestly be anything other than 0.
  1104.       Likewise printf("%d\n", 2==4), would output 0.  Usually when
  1105.       testing for truth you use the symbols > < >= <= != == && ||.
  1106.       >  greater than
  1107.       <  less than
  1108.       >= greater than or equal to
  1109.       <= less than or equal to
  1110.       != not equal to
  1111.       == equal to
  1112.       && and
  1113.       || or
  1114.       These are all logical operators as opposed to bitwise
  1115.       operators which are used to manipulate binary values.
  1116.  
  1117.    INPUTS
  1118.       <conditional statement> - A statement which evaluates to either
  1119.                                 true or false.  False is equal to 0
  1120.                                 and true is anything else, however
  1121.                                 it is common practice to have -1 or 1
  1122.                                 represent true.
  1123.       <statement sequence> - The single statement or block of
  1124.                              statements which is/are to be executed.
  1125.  
  1126.    RESULT
  1127.       none.
  1128.  
  1129.    EXAMPLE
  1130.       if (x==3) printf("x is equal to 3\n");
  1131.       else
  1132.       {
  1133.          printf("OK, you were wrong.\n");
  1134.          printf("x is not equal to 3.\n");
  1135.       }
  1136.  
  1137.    NOTES
  1138.       Get used to if.  You'll be using it a lot.
  1139.  
  1140.    BUGS
  1141.       Aside from being iffy, "Ok, Ok, bad joke", none.
  1142.  
  1143.    SEE ALSO
  1144.       switch.
  1145.  
  1146. /int                                                                     /int
  1147.  
  1148.    NAME
  1149.       int - Declares variables of type int, (quite possibly the most
  1150.             commonly used data type in C programming.)
  1151.  
  1152.    SYNOPSIS
  1153.       int <variable list>;
  1154.  
  1155.    FUNCTION
  1156.       int declares variables of type int.  Assuming that integers
  1157.       are a 16 bit data type, (on some computers they're 32 bits
  1158.       by default, but could be 64 or anything else depending on
  1159.       the hardware), an integer is any whole number which falls
  1160.       between the ranges of -32768 and 32767.  An integer must be
  1161.       at least that large.  A long integer must likewise be at
  1162.       least a 32 bit number meaning anything between -2147483648 and
  1163.       2147483647.
  1164.  
  1165.    INPUTS
  1166.       <variable list> - Is a list of variables to be declared as
  1167.                         type int separated by commas.
  1168.  
  1169.    RESULT
  1170.       none.
  1171.  
  1172.    EXAMPLE
  1173.       int x, y = 2, z[5] = {1, 2, 3, 4, 5};
  1174.  
  1175.    NOTES
  1176.       Integers are just about the fastest datatype in C.
  1177.       Calculations done with ints are lightning fast, plus
  1178.       by using the register keyword you can ask the C compiler
  1179.       to store them directly in the CPU's memory so access is
  1180.       even faster.  The down side of course is you can't do
  1181.       fractions in the traditional sense.  5/2 yields 2.  The
  1182.       remainder is simply chopped off.  To retain the whole
  1183.       answer with the remainder use the div function found in
  1184.       the stdlib.h.  There are ways you can get ints and long ints
  1185.       to do just about any job you want done, it just takes a little
  1186.       fore-thought. 
  1187.  
  1188.    BUGS
  1189.       Only works on whole numbers and can't hold very large numbers.
  1190.  
  1191.    SEE ALSO
  1192.       void, char, float, double.
  1193.  
  1194.       long, short, signed, unsigned,
  1195.       const, volatile,
  1196.       extern, static, register, auto,
  1197.       struct, union, typedef, enum.
  1198.  
  1199. /long                                                                   /long
  1200.  
  1201.    NAME
  1202.       long - Is an access modifier, which can be used to preface 
  1203.              either int or double to change their meaning, usually
  1204.              to increase their size.
  1205.  
  1206.    SYNOPSIS
  1207.       long <data type> <variable list>;
  1208.  
  1209.    FUNCTION
  1210.       Long is an access modifier, which can be used to preface either
  1211.       int or double to change their meaning, usually to increase
  1212.       their size.  long can be used by itself and it is understood
  1213.       that you mean long int.  A normal integer is usually 16 bits
  1214.       long, but a long integer is typically 32 bits long meaning
  1215.       instead of being able to only hold a max 32,767 a long can
  1216.       hold 2,147,483,647.  Similarly when used in reference to
  1217.       double it specifies that it should take up, (I think), 80
  1218.       bits instead of the normal 64.  This translates from something
  1219.       like 1.7 * 10^308 into 3.4 * 10^4932.  Don't quote me on
  1220.       that last one, I don't think long double's are very standard,
  1221.       and seriously, if you ever need a number that big, or that
  1222.       accurate, it probably means your a much better programmer than
  1223.       I, and you have no business reading this anyway unless of
  1224.       course it's for a good laugh.
  1225.  
  1226.    INPUTS
  1227.       <data type> - In this case can only be int or double.
  1228.  
  1229.       <variable list> - A list of variables to be declared as
  1230.                         long, or long double.
  1231.  
  1232.    RESULT
  1233.       none.
  1234.  
  1235.    EXAMPLE
  1236.       long x, y = 2, z = 1000000;
  1237.                     // same as long int x, y = 2, z = 1000000;
  1238.  
  1239.    NOTES
  1240.       Long is one of those funny things that got really screwed
  1241.       up when the ANSI folks decided to mess around with
  1242.       it's meaning.  Originally in the old Kernigan & Ritchie
  1243.       standard of C, long made a whole lot more sense.  You
  1244.       had the standard data types like char int and float.
  1245.       ints were either short or long, likewise floats too
  1246.       were either short or long.  If you didn't specify the
  1247.       keyword long then it was assumed to be short.  Ints were
  1248.       16 bits short 32 long, floats were 32 short and 64 long.
  1249.       In fact the keyword double and long float are synonymous.
  1250.       and long doubles didn't exist.  To me, that makes sense,
  1251.       but when the ANSI people came to standardize C compilers
  1252.       everywhere, (and they did a good job, I just don't like
  1253.       the way they did this), they not only said that we're now
  1254.       going to call long floats double and make a new long
  1255.       double type, but they made it illegal to make a long
  1256.       float.  If you try it, I'll lay you 10 to 1 odds your
  1257.       compiler will choke.  Anyway, so now years after the
  1258.       ANSI standard, long has a very obscure meaning now,
  1259.       at least in reference to what it meant originally.
  1260.  
  1261.    BUGS
  1262.       Only works with int and double.  Otherwise none.
  1263.  
  1264.    SEE ALSO
  1265.       void, int, char, float, double.
  1266.  
  1267.       short, signed, unsigned,
  1268.       const, volatile,
  1269.       extern, static, register, auto,
  1270.       struct, union, typedef, enum.
  1271.  
  1272. /register                                                           /register
  1273.  
  1274.    NAME
  1275.       register - Is an access modifier which is used to specify
  1276.                  to the compiler that the following variable
  1277.                  declarations are such that speed is crucial
  1278.                  and that the compiler should perform added
  1279.                  optimizations on these variables.
  1280.  
  1281.    SYNOPSIS
  1282.       register <data type> <variable list>;
  1283.  
  1284.    FUNCTION
  1285.       Register is an access modifier which is used to specify to the
  1286.       compiler that the following variable declarations are such that
  1287.       speed is crucial and that the compiler should perform added
  1288.       optimizations on these variables.  Really this keyword should
  1289.       only be used on ints, which you would like to be stored in
  1290.       the CPU's registers so they take up less access time, (hence
  1291.       the name register).  Only ints can be stored in the CPU's
  1292.       registers, and it should be understood that this is only
  1293.       a request and not a command, the compiler may or may not
  1294.       store the variables in question in the CPU's registers,  it
  1295.       may or may not perform added optimizations on the variables
  1296.       that can't go into the registers.
  1297.  
  1298.    INPUTS
  1299.       <data type> - Any C data type, (i.e. char, int, float, double)
  1300.       <variable list> - A list of variable being declared separated
  1301.                         by commas.
  1302.  
  1303.    RESULT
  1304.       none.
  1305.  
  1306.    EXAMPLE
  1307.       register int x, y = 0;
  1308.  
  1309.    NOTES
  1310.       It's pretty much just a simple way to make you feel like
  1311.       you've optimized your code, when in fact the speed difference
  1312.       is minimal.  Really the best way to optimize a program is well
  1313.       thought out algorithms that do their job with as little pull
  1314.       on the CPU as possible.
  1315.  
  1316.    BUGS
  1317.       It's only a request, it may or may not have any effect.
  1318.  
  1319.    SEE ALSO
  1320.       void, char, int, float, double.
  1321.  
  1322.       long, short, signed, unsigned,
  1323.       const, volatile,
  1324.       extern, static, auto,
  1325.       struct, union, typedef, enum.
  1326.  
  1327. /return                                                               /return
  1328.  
  1329.    NAME
  1330.       return - Exits a function immediately and a return value may
  1331.                be specified.
  1332.  
  1333.    SYNOPSIS
  1334.       <data type> <function name>(<argument list>)
  1335.       {
  1336.          <statement sequence>;
  1337.          return <return value>;
  1338.       }
  1339.  
  1340.    FUNCTION
  1341.       Return exits a function immediately and a return value may
  1342.       be specified.  Unless a function declares a void return type
  1343.       it must have at least one return statement that terminates
  1344.       the function and returns a value of the appropriate type.
  1345.       A function may have multiple return statements.
  1346.  
  1347.    INPUTS
  1348.       <data type> - May be any of C's built in data types or it
  1349.                     may be a user defined (complex) data type, such
  1350.                     as a struct.
  1351.       <function name> - Any valid identifier which serves as the
  1352.                         name of the function.
  1353.       <argument list> - An argument list consists of variable
  1354.                         declarations separated by commas.  See
  1355.                         the example for clarification on this.
  1356.       <statement sequence> - The single statement or block of
  1357.                              statements which is/are to be executed.
  1358.       <return value> - The data to be passed back to the routine
  1359.                        that originally called the function.
  1360.  
  1361.    RESULT
  1362.       What should I write for this, it is the result.  This is the
  1363.       mechanism by which a result is produced.
  1364.  
  1365.    EXAMPLE
  1366.       int main(int argc, char *argv)
  1367.       {
  1368.  
  1369.          printf("Hello dare\n");
  1370.          return 0;
  1371.       }
  1372.  
  1373.    NOTES
  1374.       none.
  1375.    BUGS
  1376.       none.
  1377.  
  1378.    SEE ALSO
  1379.  
  1380. /short                                                                 /short
  1381.  
  1382.    NAME
  1383.       short - Is an access modifier, which can be used to preface 
  1384.               int to change it's meaning.
  1385.  
  1386.    SYNOPSIS
  1387.       short int <variable list>;
  1388.  
  1389.    FUNCTION
  1390.       short is an access modifier, which can be used to preface int
  1391.       to change it's meaning.  Actually, in practice, a short int
  1392.       is the same as saying int, and likewise short can be specified
  1393.       by itself where the definition short x; is the same as saying
  1394.       int x;  technically, ints can be 16 or 32 bits, (or really any
  1395.       number of bits depending on the machine), and short is any
  1396.       number of bits less than or equal to the default int.
  1397.  
  1398.    INPUTS
  1399.       <variable list> - A list of variables to be declared separated
  1400.                         by commas.
  1401.  
  1402.    RESULT
  1403.       none.
  1404.  
  1405.    EXAMPLE
  1406.       short int x, y = 0;
  1407.          // same as short x, y = 0;
  1408.  
  1409.    NOTES
  1410.       Short and long are two of a kind so you should take a look
  1411.       at what long is all about as well.  Short can only be applied
  1412.       to integers, while long can be applied to ints and doubles.
  1413.       Again I think the ANSI standard kind of changed the meaning of
  1414.       short, which is all right, and since I don't know how it was
  1415.       originally used, and don't have any pre-ANSI compilers to test
  1416.       it out on, I'm just going to leave a big hairy blank on the
  1417.       history.  In general short and long should only be used on
  1418.       ints, and on a more personal note, I've never used the short
  1419.       keyword once to my recollection.  Usually it's assumed that
  1420.       ints are shorts, and if your computer or compiler is more
  1421.       comfortable with 32 bit numbers than 16, why limit the size
  1422.       when there's no need.  Bottom line, you'll probably use long
  1423.       all the time, but probably forget short even exists.
  1424.  
  1425.    BUGS
  1426.       none to my knowledge.
  1427.  
  1428.    SEE ALSO
  1429.       long,
  1430.  
  1431.       void, int, char, float, double.
  1432.  
  1433.       signed, unsigned,
  1434.       const, volatile,
  1435.       extern, static, register, auto,
  1436.       struct, union, typedef, enum.
  1437.  
  1438. /signed                                                               /signed
  1439.  
  1440.    NAME
  1441.       signed - Is an access modifier which may be used on either
  1442.                character or integer data types.
  1443.  
  1444.    SYNOPSIS
  1445.       signed <data type> <variable list>;
  1446.  
  1447.    FUNCTION
  1448.       Signed is an access modifier which may be used on either
  1449.       character or integer data types.  Signed is used mainly
  1450.       to specify that a char can either be negative or positive.
  1451.       Doing this causes the maximum number a char can hold to be
  1452.       cut in half.  Really all variable types, including char, are
  1453.       signed by default so I'm not sure that there is ever an
  1454.       instance where you would want to use this modifier.
  1455.  
  1456.    INPUTS
  1457.       <data type> - In this case either char or int.
  1458.       <variable list> - A list of variables to be declared separated
  1459.                         by commas.
  1460.  
  1461.    RESULT
  1462.       none.
  1463.  
  1464.    EXAMPLE
  1465.       signed char x, y = -100;
  1466.       printf("%d\n", y);
  1467.  
  1468.    NOTES
  1469.       Notice that in the example above when I printed y with
  1470.       printf I used a %d instead of %c which is normally used
  1471.       for characters.  The reason is, I'm using the type char
  1472.       here to store numbers and not characters in the normal sense.
  1473.  
  1474.    BUGS
  1475.       none.
  1476.  
  1477.    SEE ALSO
  1478.       unsigned,
  1479.  
  1480.       void, int, char, float, double.
  1481.  
  1482.       long, short, const, volatile,
  1483.       extern, static, register, auto,
  1484.       struct, union, typedef, enum.
  1485.  
  1486. /sizeof                                                               /sizeof
  1487.  
  1488.    NAME
  1489.      sizeof - Is used to calculate the size of variables and other
  1490.               objects.
  1491.  
  1492.    SYNOPSIS
  1493.      size_t sizeof(<variable type>)<expression>;
  1494.      or
  1495.      size_t sizeof <variable> <expression>;
  1496.  
  1497.    FUNCTION
  1498.       Sizeof is used to calculate the size of variables and other
  1499.       objects.  Sizeof is useful in determining the size of a
  1500.       variable or other object, but it's most useful application is
  1501.       in calculating the size for an object that is being dynamically
  1502.       allocated.  Basically malloc() and sizeof go together like
  1503.       peanut butter and jelly.
  1504.  
  1505.    INPUTS
  1506.       <variable type> - Can be any of C's built in type's or a user
  1507.                         defined type like a struct or something.
  1508.       <variable> - Or you can use the variable itself.  sizeof will
  1509.                    return how much memory it's taking up.
  1510.       <expression> - Any expression which you might want to use to
  1511.                      modify the number that sizeof returns.
  1512.  
  1513.    RESULT
  1514.       size_t - Is the size of the object passed to sizeof in bytes.
  1515.                size_t is defined in stddef.h.  Technically speaking,
  1516.                sizeof figures an objects size as a multiple of the
  1517.                char type, (which is almost always a byte).  If your
  1518.                computer stores characters in something larger than
  1519.                an 8 bit byte, then you might have to rethink your
  1520.                implementation.  In practice though, I've never heard
  1521.                of this happening.
  1522.  
  1523.    EXAMPLE
  1524.       #include <stdio.h>
  1525.       #include <stdlib.h>
  1526.  
  1527.       struct test
  1528.       {
  1529.          int i;
  1530.          char c;
  1531.       } teststruct; typedef struct test test;
  1532.       
  1533.       int main(void)
  1534.       {
  1535.          int x, *ptr;
  1536.          ptr = (int *)malloc(sizeof(int)*5);
  1537.          for (x = 0; x < 5; x++)
  1538.          {
  1539.              *(ptr+x) = x;
  1540.              printf("%d\n", *(ptr+x));
  1541.          }
  1542.          printf("Won't work, sizeof ptr isn't %d\n", sizeof(ptr));
  1543.          printf("size of x is %d\n", sizeof(x));
  1544.          printf("size of teststruct is %d\n", sizeof(teststruct));
  1545.          printf("testtruct should be sizeof(int)+sizeof(char).\n");
  1546.          printf("just to test, sizeof(int)+sizeof(char)==%d\n",
  1547.             sizeof(int)+sizeof(char));
  1548.          return 0;
  1549.       }
  1550.  
  1551.    NOTES
  1552.       Sizeof is a unary operator.  I almost always use it as though
  1553.       it were a function, but it is an operator none the less.
  1554.       malloc and it's related functions calloc realloc and free
  1555.       which are used to allocate memory from the operating system
  1556.       are where sizeof gets used most often.
  1557.       Also the type size_t is defined in stddef.h.
  1558.  
  1559.    BUGS
  1560.       none.
  1561.  
  1562.    SEE ALSO
  1563.       size_t, malloc, calloc, realloc, free. 
  1564.  
  1565. /static                                                               /static
  1566.  
  1567.    NAME
  1568.       static - Is used to specify that a variable is to remain in
  1569.                memory even when the function or block to which
  1570.                it is assigned goes out of scope.
  1571.  
  1572.    SYNOPSIS
  1573.       static <data type> <variable list>
  1574.  
  1575.    FUNCTION
  1576.       Static is used to specify that a variable is to remain in
  1577.       memory even when the function or block to which it is assigned
  1578.       goes out of scope.  Simply stated, normally when you exit a
  1579.       function, all local variables in that function are destroyed
  1580.       so the memory can be used elsewhere, (i.e., when you go back
  1581.       into that function later, the variables are not the same as
  1582.       when you left the function.)  The static keyword specifies
  1583.       that you don't want the memory to be dumped, so when you
  1584.       come back into the function, everything is just as you left
  1585.       it.  There are two practical uses for static variables that
  1586.       come blaringly to mind.  One is when you need to keep track
  1587.       of some bit of info between function calls, (like maybe
  1588.       how many times you've called the function or something).  The
  1589.       other is when you want to return a pointer to info generated
  1590.       by the function, but don't want to declare a global variable
  1591.       and call by value isn't economical.
  1592.  
  1593.       There is a another and somewhat confusing use of the keyword
  1594.       static, which is to specify that a global identifier, (which
  1595.       can be any identifier including a variable or function), is
  1596.       to have internal linkage.  What this means is basically that
  1597.       say you have two source code files and both of them contain
  1598.       either functions and/or variables with the same names.  If you
  1599.       try to compile them together, you'll get an error from the
  1600.       compiler.  If you declare the vars and or functions in question
  1601.       with the static keyword it tells the compiler that the source
  1602.       code is useing the variable within itself and not the one that
  1603.       was defined in the other source code file.  At first this looks
  1604.       like a useless feature that no-one in their right mind would
  1605.       use, but it does have one VERY important use.  The problem with
  1606.       global variables is that they can very quickly polute your code
  1607.       which is why you're encouraged to use static variables within
  1608.       a function.  Sometimes however, you have to use a global var
  1609.       to get the job done, and there's no way around it.  Well if
  1610.       you're working on a large project made up of multiple files
  1611.       you can use the static keyword when you define your global
  1612.       variable, and it will in effect shield all the other source
  1613.       file segments from your global variable.  They won't be
  1614.       aware that it even exists.  I suggest you play with this a
  1615.       little, as it's an extremely useful tool for allowing you to
  1616.       "cheat" the system, and still have super clean code.
  1617.  
  1618.    INPUTS
  1619.       <data type> - Any of C's built in data types, or a user defined
  1620.                     (complex) data type of your own.
  1621.       <variable list> - A list of variables being declared separated
  1622.                         by commas.
  1623.  
  1624.    RESULT
  1625.       none.
  1626.  
  1627.    EXAMPLE
  1628.       #include <stdio.h>
  1629.  
  1630.       int *test(int a, int b);
  1631.  
  1632.       int main(void)
  1633.       {
  1634.          int x, *mainptr;
  1635.  
  1636.          mainptr = test(0, 10);
  1637.          for (x = 0; x < 10; x++) printf("%d\n", *(ptr+x));
  1638.          printf("\n\n\n");
  1639.          mainptr = test(5, 15);
  1640.          for (x = 0; x < 15; x++) printf("%d\n", *(ptr+x));
  1641.  
  1642.          return 0;
  1643.       }
  1644.  
  1645.       int *test(int a, int b)
  1646.       {
  1647.          int x;
  1648.          static int *ptr = NULL;
  1649.  
  1650.          if (ptr==NULL) ptr = (int *)malloc(sizeof(int)*b);
  1651.          else ptr = (int *)realloc(ptr, sizeof(int)*b); 
  1652.          for (x = a; x < b; x++) *(ptr+x) = x;
  1653.          return ptr;
  1654.       }
  1655.  
  1656.    NOTES
  1657.       Static shouldn't be used when it's not needed, but it is an
  1658.       invaluable tool for maintaining the structure of a program
  1659.       when trying to do some things.  Mainly static's main purpose
  1660.       for existing is to limit the need for global variables.
  1661.       Indeed even when the use of global variables is necessary,
  1662.       the static keyword can be used to limit the impact they have
  1663.       on the overall program.
  1664.  
  1665.    BUGS
  1666.       none.  Sorry if I didn't explain this keyword well.  It's
  1667.       a little hard for me to word.  When all else fails,
  1668.       experiment, a little old fashioned hacking never hurt
  1669.       anyone.
  1670.  
  1671.    SEE ALSO
  1672.       auto, extern, register, const, volatile,
  1673.  
  1674.       void, char, int, float, double.
  1675.       long, short, signed, unsigned,
  1676.       struct, union, typedef, enum.
  1677.  
  1678. /struct                                                               /struct
  1679.  
  1680.    NAME
  1681.       struct - Is used to create user defined (complex) variable
  1682.                types on top of C's built in types.
  1683.  
  1684.    SYNOPSIS
  1685.       struct <type name>
  1686.       {
  1687.          <variable declarations>;
  1688.       } <global variable list>;
  1689.  
  1690.    FUNCTION
  1691.       Struct is used to create user defined (complex) variable
  1692.       types on top of C's built in types.  Basically struct allows
  1693.       you to structure a bunch of variables into a logical grouping.
  1694.       If your familiar with the concept and terminology of databases
  1695.       a struct is like making a field, which will later contain
  1696.       a whole bunch of data pertaining to a single subject.
  1697.       If the idea is unclear, try looking at the example for
  1698.       clarification.
  1699.  
  1700.    INPUTS
  1701.       <type name> - Is the name of the new type you are creating.
  1702.                     Think of this as roughly corresponding to int,
  1703.                     char, or float or the like with the exception
  1704.                     that this is your own custom variable type.
  1705.       <variable declarations> - Several lists of variable
  1706.                                 declarations which may be made up of
  1707.                                 any of C's built in types, or of
  1708.                                 other user defined (complex) types
  1709.                                 defined elsewhere.
  1710.       <global variable list> - A list of variables of this newly
  1711.                                defined type separated by commas.  Any
  1712.                                variables declared here are considered
  1713.                                global.  You may declare global
  1714.                                variables of this type elsewhere but
  1715.                                it is considered proper to do it here.
  1716.  
  1717.    RESULT
  1718.       none.
  1719.  
  1720.    EXAMPLE
  1721.       #include <stdio.h>
  1722.       #include <string.h>
  1723.  
  1724.       struct phonepage
  1725.       {
  1726.          char name[257];
  1727.          int areacode, localcode, fourdigitcode;
  1728.          char address[257];
  1729.       } phonebook[10];
  1730.  
  1731.       // the following line is just so you can type phonepage
  1732.       // instead of typing struct phonepage to declare a variable
  1733.       // of that type.  THIS IS NOT A NECESSARY STATEMENT.
  1734.       // It is intended to make the meaning of the statements in main
  1735.       // stand out more clearly.
  1736.       typedef struct phonepage phonepage;
  1737.  
  1738.       int main(void)
  1739.       {
  1740.          phonepage myfriend;
  1741.  
  1742.          strcpy(myfriend.name, "Harry");
  1743.          myfriend.areacode = 900;            
  1744.          myfriend.localcode = 555;
  1745.          myfriend.fourdigitcode = 1234;
  1746.          strcpy(myfriend.address,
  1747.             "Beverly Hill 90210, <Yeah right ;-)>");
  1748.  
  1749.          phonebook[0] = myfriend;
  1750.  
  1751.          printf("My friend's name is %s\n", phonebook[0].name);
  1752.          printf("My friend's phone number is (%d) %d-%d\n",
  1753.             phonebook[0].areacode, phonebook[0].localcode,
  1754.             phonebook[0].fourdigitcode);
  1755.          printf("my friend's address is %s\n", phonebook[0].address);
  1756.  
  1757.          return 0;
  1758.       }
  1759.  
  1760.    NOTES
  1761.       When I first started learning C, the syntax of how to construct
  1762.       a struct really baffled me, mostly because in many of
  1763.       the books I was reading each programmer had a different way
  1764.       of doing it.  Specifically the difference between the name at
  1765.       the beginning and the list of names that follows the definition
  1766.       threw me for a loop.  It was never impressed on me by the
  1767.       different authors, that the name at the top is a new variable
  1768.       type, and the list of names at the end are simply variables of
  1769.       that type.  Structs are really the first glimmer of the object
  1770.       oriented way of looking at a problem.  C is not an object
  1771.       oriented language, but structs promote the grouping of data
  1772.       into logical/conceptual objects.  C++ takes the next step and
  1773.       lets you put code into your own variables as well as data.
  1774.       There's more to object oriented programming then just that,
  1775.       but I'm just trying to impress that if you've no idea what
  1776.       object oriented programming is, Structs definitely fall into
  1777.       the spirit of object oriented programming.
  1778.       P.S. a structure can also be used to create a bit field.
  1779.       A bit field is useful when you want to pack as much info
  1780.       into a given piece of memory as is humanly possible.
  1781.       This is an advanced technique which I'm too lazy to go into
  1782.       in depth here.  If you think you might need one, or are just
  1783.       interested, or need the syntax, pick up any book on C
  1784.       programming and look in the index for bit fields.
  1785.       A bit field looks something like this,
  1786.       struct test
  1787.       {
  1788.          int bool1 : 1;
  1789.          int bool2 : 1;
  1790.          int byte1 : 8;
  1791.          int byte2 : 8;
  1792.       } ;
  1793.  
  1794.    BUGS
  1795.       none.
  1796.  
  1797.    SEE ALSO
  1798.       typedef, union, enum,
  1799.  
  1800.       void, char, int, float, double.
  1801.       long, short, signed, unsigned,
  1802.       const, volatile,
  1803.       extern, static, register, auto.
  1804.  
  1805. /switch                                                               /switch
  1806.  
  1807.    NAME
  1808.       switch - A statement used to choose between alternate courses
  1809.                of action based on an integer or enumeration value.
  1810.  
  1811.    SYNOPSIS
  1812.       switch (<variable>)
  1813.       {
  1814.          case <const value>:
  1815.             <statement sequence>;
  1816.             break; // if this is omitted, 2nd case will execute too.
  1817.          case <const value>:
  1818.             <statement sequence>;
  1819.             break;
  1820.          default:
  1821.             <statement sequence>;
  1822.       }
  1823.  
  1824.    FUNCTION
  1825.       Switch is a statement used to choose between alternate courses
  1826.       of action based on an integer or enumeration value.  Switch
  1827.       is similar in purpose to an If-Then, but is more restrictive.
  1828.       Essentially all a switch can test for is equality.  When a
  1829.       single variable must be tested multiple times for equality
  1830.       and a simple inequality won't suffice, a switch statement
  1831.       can add more clarity to the code then an if-else if ladder.
  1832.  
  1833.    INPUTS
  1834.       <variable> - The variable that is to be tested in the body of
  1835.                    the switch statement.
  1836.       <const value> - Any constant expression that evaluates to an
  1837.                       integer number.  If the <variable> is equal
  1838.                       to this number, then the statement sequence
  1839.                       directly after is executed.  const value may
  1840.                       not contain any variables.
  1841.       <statement sequence> - The single statement or block of
  1842.                              statements which is/are to be executed. 
  1843.  
  1844.    RESULT
  1845.       none.
  1846.  
  1847.    EXAMPLE
  1848.       #include <stdio.h>
  1849.  
  1850.       int main(void)
  1851.       {
  1852.          int x = 2;
  1853.  
  1854.          switch (x)
  1855.          {
  1856.             case 1:
  1857.                printf("1\n");
  1858.                break;
  1859.             case 2:
  1860.                printf("2\n");
  1861.                break;
  1862.             default:
  1863.                printf("3\n");
  1864.          }
  1865.          return 0;
  1866.       }
  1867.  
  1868.    NOTES
  1869.       Switch is often used when the user is supposed to select
  1870.       one of several options.  Menu programs, and similar progs
  1871.       that prompt for user input can benefit from the use of
  1872.       switches.  Also, remember, switch only works with integral
  1873.       types.  This could be a char, int or enumeration.
  1874.  
  1875.    BUGS
  1876.       none.
  1877.    SEE ALSO
  1878.       case, break, default, int, enum,
  1879.       if, else.
  1880.  
  1881. /typedef                                                             /typedef
  1882.  
  1883.    NAME
  1884.       typedef - Is a C keyword for creating an alias for data types.
  1885.  
  1886.    SYNOPSIS
  1887.       typedef <old name> <new name>;
  1888.  
  1889.    FUNCTION
  1890.       Typedef is a C keyword for creating an alias for data types.
  1891.       Typedef can be used to substitute your own names for variable
  1892.       types, like typedef unsigned char byte;.  Also you can use it
  1893.       to abbreviate long type definitions so their not such a pain to
  1894.       type.
  1895.  
  1896.    INPUTS
  1897.       <old name> - This is the old data type name.  It can be made up
  1898.                    of several names, like unsigned char or
  1899.                    struct test.
  1900.       <new name> - This is the alias of the data type.  This
  1901.                    can't contain any spaces as C assumes the last
  1902.                    word in a typedef statement is the alias.  Also
  1903.                    it should be noted that you may specify that the
  1904.                    new type should inherently an array or pointer or
  1905.                    something, (i.e., typedef char strtype[257]; or
  1906.                    typedef int *intptr;).
  1907.  
  1908.    RESULT
  1909.       none.                                  
  1910.  
  1911.    EXAMPLE
  1912.       typedef char strtype[257];
  1913.       typedef int *intptr;
  1914.       typedef struct
  1915.       {
  1916.          strtype str;                                    
  1917.          int x, y, z;
  1918.       } structtype;
  1919.       
  1920.    NOTES
  1921.       The last part of the example is a little ambiguous and deserves
  1922.       some explanation.  In a normal struct definition, any name that
  1923.       follows the closing bracket is the name of a global variable
  1924.       that you are declaring.  In this instance typedef is saying to
  1925.       replace structtype with the whole struct definition.  To
  1926.       demonstrate what I'm talking about, try compiling the following
  1927.       example.
  1928.       #include <stdio.h>
  1929.       #include <string.h>
  1930.  
  1931.       int main(void)
  1932.       {
  1933.          struct {int x, y, z; char str[257];} hello;
  1934.  
  1935.          strcpy(hello.str, "Hello There\n");
  1936.  
  1937.          printf("%s\n", hello.str);
  1938.  
  1939.          return 0;
  1940.       }
  1941.       In this code fragment, hello is a variable, and the part that
  1942.       says struct {int x, y, z; char str[257];} IS the data type.
  1943.       you are basically assigning the variable hello a unique data
  1944.       type that can't be assigned anywhere else unless of course you
  1945.       were to re-specify the struct from scratch.  
  1946.  
  1947.    BUGS
  1948.       none.
  1949.    SEE ALSO
  1950.       struct, union, enum, void, int, char, float, double.
  1951.                                                               
  1952. /union                                                                 /union
  1953.  
  1954.    NAME
  1955.       union - Similar to struct, but specifies that it's data members
  1956.               are to occupy the same area of memory.
  1957.  
  1958.    SYNOPSIS
  1959.       union <type name>
  1960.       {
  1961.          <variable declarations>;
  1962.       } <global variable list>;
  1963.  
  1964.    FUNCTION
  1965.       Union is similar to struct, but specifies that it's data
  1966.       members are to occupy the same area of memory.  So, if you
  1967.       specified a union (union test {int x; char c;} ;) then
  1968.       any data assigned to c is also assigned to the low order
  1969.       bits of x, and any value assigned to x can also be accessed
  1970.       by c assuming that value is no larger than 8 bits in which
  1971.       case the value returned by c is truncated.
  1972.  
  1973.    INPUTS
  1974.       <type name> - Is the name of the new type you are creating.
  1975.                     Think of this as roughly corresponding to int,
  1976.                     char, or float or the like with the exception
  1977.                     that this is your own custom variable type.
  1978.       <variable declarations> - Several lists of variable
  1979.                                 declarations which may be made up of
  1980.                                 any of C's built in types, or of
  1981.                                 other user defined (complex) types
  1982.                                 defined elsewhere.
  1983.       <global variable list> - A list of variables of this newly
  1984.                                defined type separated by commas.  Any
  1985.                                variables declared here are considered
  1986.                                global.  You may declare global
  1987.                                variables of this type elsewhere but
  1988.                                it is considered proper to do it here.
  1989.  
  1990.    RESULT
  1991.       none.
  1992.  
  1993.    EXAMPLE
  1994.       #include <stdio.h>
  1995.       #include <values.h>
  1996.  
  1997.       union test
  1998.       {
  1999.          int x;
  2000.          char c;
  2001.       } ;
  2002.       
  2003.       int main(void)
  2004.       {
  2005.          union test aunion;
  2006.       
  2007.          aunion.x = MAXINT;
  2008.       
  2009.          printf("%d\n", aunion.x);
  2010.       
  2011.          aunion.c = 'a';
  2012.       
  2013.          printf("%d\n", (int)aunion.c);
  2014.          printf("%d\n", aunion.x);
  2015.       
  2016.          return 0;
  2017.       }
  2018.  
  2019.  
  2020.    NOTES
  2021.       Unions only have a few very specialized applications in low
  2022.       level programming.  For instance when writing the malloc
  2023.       function, programmers generally use a union to control how the
  2024.       memory is allocated.  For application programmers, (That's you
  2025.       and me), I can't off hand think of any situation that would
  2026.       warrant the use of a union.
  2027.  
  2028.    BUGS
  2029.       none.
  2030.  
  2031.    SEE ALSO
  2032.       struct, enum, typedef, void, int, char, float, double.
  2033.  
  2034. /unsigned                                                           /unsigned
  2035.  
  2036.    NAME
  2037.       unsigned - Is an access modifier which may be used on either
  2038.                  character or integer data types.
  2039.  
  2040.    SYNOPSIS
  2041.       unsigned <data type> <variable list>;
  2042.  
  2043.    FUNCTION
  2044.       Unsigned is an access modifier which may be used on either
  2045.       character or integer data types.  Unsigned is used mainly
  2046.       to extend the maximum value an integer, (or other integral
  2047.       type), may hold.  (An integral type is any built in,
  2048.       non-floating point, type.  Definitely not complex types.)
  2049.  
  2050.    INPUTS
  2051.       <data type> - In this case either char or int.
  2052.       <variable list> - A list of variables to be declared separated
  2053.                         by commas.
  2054.  
  2055.    RESULT
  2056.       none.
  2057.  
  2058.    EXAMPLE
  2059.       unsigned int x, y = 40000;
  2060.       printf("%d\n", y);
  2061.  
  2062.    NOTES
  2063.       Normally an integer value is 16 bits long, translating into
  2064.       any number between -32767 and 32767.  Making an int unsigned
  2065.       will effectively change the range to 0 through 65,??? basically
  2066.       doubling highest possible positive integer.  This can be
  2067.       useful when you need numbers slightly higher than 32767 but
  2068.       don't need to store any negative values, like in a loop
  2069.       counter or something.
  2070.  
  2071.    BUGS
  2072.       none.
  2073.  
  2074.    SEE ALSO
  2075.       signed,
  2076.  
  2077.       void, int, char, float, double.
  2078.  
  2079.       long, short, const, volatile,
  2080.       extern, static, register, auto,
  2081.       struct, union, typedef, enum.
  2082.  
  2083. /void                                                                   /void
  2084.  
  2085.    NAME
  2086.       void - Used to specify that a function doesn't return any
  2087.              return values, or can declare void pointers which
  2088.              can hold a pointer of any type.
  2089.  
  2090.    SYNOPSIS
  2091.       void <function name>();
  2092.          or
  2093.       void *<var or func name>;
  2094.  
  2095.    FUNCTION
  2096.       Void is used to specify that a function doesn't return any
  2097.       return values, or can declare void pointers which
  2098.       may be cast into any other ptr type without explicit casting.
  2099.       note that C++ is a little more strict about using a void
  2100.       ptr as an implicit cast and you may have to go ahead and
  2101.       cast it explicitly if your using a C++ compiler.
  2102.  
  2103.    INPUTS
  2104.       <function name> - Any valid function name which will have a
  2105.                         void return type specifying that this
  2106.                         function has no return type.
  2107.       <var or func name> - If it is a variable name then you
  2108.                            are specifying a void ptr variable type.
  2109.                            if it is a function name then you
  2110.                            are specifying a void ptr return type.
  2111.                            A void ptr return type does not indicate
  2112.                            no return value.  It specifies that the
  2113.                            type of the pointer which is being
  2114.                            returned is generic and may be any type.
  2115.  
  2116.    RESULT
  2117.       none.
  2118.  
  2119.    EXAMPLE
  2120.       #include <stdio.h>
  2121.       #include <stdlib.h>
  2122.  
  2123.       int main(void)
  2124.       {
  2125.          int *x;
  2126.          x = malloc(sizeof(int));
  2127.       
  2128.          *x = 67;
  2129.       
  2130.          printf("%d\n", *x);
  2131.       
  2132.          return 0;
  2133.       }
  2134.  
  2135.    NOTES
  2136.       In the example above, malloc returns a void ptr.  This
  2137.       allows x to be assigned the value even though it is an
  2138.       integer pointer.
  2139.       In addition to all I've said so far, I think that void used as
  2140.       a return type signifying no return type, was instituted by the
  2141.       ANSI standard.  I believe they did it this way because of
  2142.       some incompatibility with the previous syntax for defining
  2143.       C functions in the Ritchie/Kernigan definition.  I think
  2144.       they wanted to maintain compatibility with programs using the
  2145.       older definitions, but needed to find a way to distinguish
  2146.       between the two.  I don't know the details as I'm not very
  2147.       familiar with that definition of C since it is quit old,
  2148.       (at least a decade now).  A lot of old code uses it though
  2149.       so it's useful to know the distinction.  You should use the
  2150.       new syntax though as it allows better type checking by the
  2151.       compiler, and on top of that I recommend always declaring
  2152.       return types even if the return type is int, because the
  2153.       latest definition of C++ doesn't support implicit int
  2154.       return types anymore.  "If your like me, you use C AND
  2155.       C++ compilers to compile your C programs, (depending on the
  2156.       tools you have available to you at the time), plus it's just
  2157.       a good idea to make your C programs compatible with C++
  2158.       just in case you ever want to go to it later.  You might
  2159.       want to mix your old routines with your new code or something.
  2160.  
  2161.    BUGS
  2162.       none.
  2163.  
  2164.    SEE ALSO
  2165.       signed,
  2166.  
  2167.       void, int, char, float, double.
  2168.  
  2169.       long, short, const, volatile,
  2170.       extern, static, register, auto,
  2171.       struct, union, typedef, enum.
  2172.       
  2173.  
  2174. /volatile                                                           /volatile
  2175.  
  2176.    NAME
  2177.       volatile - Is an access modifier which specifies that a given
  2178.                  variable may be altered by another program outside
  2179.                  the current program's control and for the compiler
  2180.                  to perform no optimizations that would cause an
  2181.                  error should such an outside alteration happen.
  2182.  
  2183.    SYNOPSIS
  2184.       volatile <data type> <variable list>;
  2185.  
  2186.    FUNCTION
  2187.       Volatile is an access modifier which specifies that a given
  2188.       variable may be altered by another program outside the current
  2189.       program's control and for the compiler to perform no
  2190.       optimizations that would cause an error should such an outside
  2191.       alteration happen.  Most frequently, this type of variable is
  2192.       used when you want your program to access some fixed hardware
  2193.       (or software) resource which is regulated by the OS and/or
  2194.       other programs must access and/or change it.  A good example
  2195.       of this is if you wanted to access the computer's clock
  2196.       directly.  You'd assign a pointer to wherever the time info
  2197.       is kept in the computer, and whenever you'd want to know
  2198.       the time you could just take a look at that pointer.
  2199.  
  2200.    INPUTS
  2201.       <data type> - Any of C's built in types or your own user
  2202.                     defined (complex) data type.
  2203.       <variable list> - A list of variables being declared separated
  2204.                         by commas.
  2205.  
  2206.    RESULT
  2207.       none.
  2208.  
  2209.    EXAMPLE
  2210.       volatile int x;
  2211.  
  2212.    NOTES
  2213.       Anytime one uses the volatile keyword, it denotes that your
  2214.       getting pretty close to the system, IE pretty low level.  If
  2215.       your trying to write portable software that will compile on
  2216.       multiple platforms, (which should be the goal of every good
  2217.       little programmer), it's not a good idea to start accessing
  2218.       hardware, which may or may not exist on other platforms or
  2219.       even later models of the same type of computer, (DOES AGA
  2220.       RING ANY BELLS HERE).  In closing, this keyword is best left
  2221.       to system and compiler programmers.
  2222.  
  2223.       PS, Don't take my word on this as gospel, I'm not very
  2224.       familiar with volatile and it's uses.
  2225.  
  2226.    BUGS
  2227.       none.
  2228.  
  2229.    SEE ALSO
  2230.       const, extern, static, register, auto.
  2231.  
  2232. /while                                                                 /while
  2233.  
  2234.    NAME
  2235.       while - Used to form a while loop, the most basic looping
  2236.               structure in C.
  2237.  
  2238.    SYNOPSIS
  2239.       while (<condition>)
  2240.       {
  2241.          <statement sequence>;
  2242.       }
  2243.  
  2244.    FUNCTION
  2245.      While is used to form a while loop, the most basic looping
  2246.      structure in C.  While executes while the <condition> is true,
  2247.      when the condition becomes false the loop exits.  The test
  2248.      condition is evaluated first when you enter the loop and then
  2249.      once every time the loop finishes a cycle.
  2250.  
  2251.    INPUTS
  2252.       <condition> - Any valid C expression that evaluates to either
  2253.                     true of false.
  2254.       <statement sequence> - The single statement or block of
  2255.                              statements which is/are to be executed.
  2256.  
  2257.    RESULT
  2258.       none.
  2259.  
  2260.    EXAMPLE
  2261.       x = 0;
  2262.       while (x<10)
  2263.       {
  2264.          x++;
  2265.          printf("%d\n", x);
  2266.       }
  2267.  
  2268.    NOTES
  2269.       While and do while differ only in that a do while evalutes it's
  2270.       conditional statement after the first iteration and while
  2271.       evaluates it's expression before the loop is executed.  This
  2272.       distinction can have a profound effect on what happens if
  2273.       one is unaware of the distinction, however the loops can
  2274.       generally substitute each other with minor modification.
  2275.  
  2276.    BUGS
  2277.       none.
  2278.  
  2279.    SEE ALSO
  2280.       do, for, switch, break, continue, default, if, else.
  2281.  
  2282.